#ifndef HASHTABLEHOLDER_H_JM_20130220
#define HASHTABLEHOLDER_H_JM_20130220

#include "../mutex/mutex.h"
#include "../../boxes/BoxBaseTypes.h"

// ## jmlib
#include <jmlib/tables/hashTable/HashTable.h>
#include <jmlib/tables/hashTable/BoostHashWrapper.h>

namespace jm4bbx {

	template<typename T>
	class  HashTableHolder {
	public:
		typedef T KeyType;
		typedef KeyMultiRecords<T> ValueType;

		typedef jmlib::HashTable<KeyType, ValueType, Mutex, 
			Lock<Mutex>::ScopeLock> HashTable;

		typedef typename HashTable::HashEntry HashEntry;
		typedef typename HashTable::ExtendedHashEntry ExtendedHashEntry;

		static HashTable* getHashTable() {
			return &hashTable_;
		}		

	private:
		static HashTable hashTable_;

		HashTableHolder();
	};

	template<typename T>
	 typename HashTableHolder<T>::HashTable HashTableHolder<T>::hashTable_(
		1000000, typename HashTableHolder<T>::HashTable::HashFunctorPtr(
			new jmlib::BoostHashWrapper<KeyType>()));;

} // namespace jm4bbx


#endif
